package com.smart.car.common.res.constant;

/**
 * 状态码封装
 * 成功：2XX系列
 * 业务异常：4XX系列
 * 主机异常：5XX系列
 * @author: zoutao
 * @date: 2021/4/24
 */

public class Constants {

    /**
     * 查询、删除成功标记
     */
    public static final Integer SUCCESS = 200;
    public static final String SUMSG = "请求成功";
    /**
     * 对象创建，修改成功
     */
    public static final int CREATED = 201;
    public static final String CRMSG = "操作成功";

    /**
     * 操作已经执行成功，但是没有返回数据
     */
    public static final int NO_CONTENT = 204;

    /**
     * 失败标记
     */
    public static final Integer FAIL = 500;

    /**
     * 资源已被移除
     */
    public static final int MOVED_PERM = 301;

    /**
     * 重定向
     */
    public static final int SEE_OTHER = 303;

    /**
     * 资源没有被修改
     */
    public static final int NOT_MODIFIED = 304;

    /**
     * 参数列表错误（缺少，格式不匹配）
     */
    public static final int BAD_REQUEST = 400;
    public static final String VALID_EXCEPTION_MSG="参数格式错误";

    /**
     * 未授权
     */
    public static final int UNAUTHORIZED = 401;

    /**
     * 访问受限，授权过期
     */
    public static final int FORBIDDEN = 403;

    /**
     * 资源，服务未找到
     */
    public static final int NOT_FOUND = 404;

    /**
     * 不允许的http方法
     */
    public static final int BAD_METHOD = 405;

    /**
     * 资源冲突，或者资源被锁
     */
    public static final int CONFLICT = 409;

    /**
     * 不支持的数据，媒体类型
     */
    public static final int UNSUPPORTED_TYPE = 415;

    /**
     * 系统内部错误.未知异常
     */
    public static final int UNKNOWN_EXCEPTION_CODE = 500;
    public static final String  UNKNOWN_EXCEPTION_MSG = "服务器出错啦";

    /**
     * 接口未实现
     */
    public static final int NOT_IMPLEMENTED = 501;

    /**
     * 被sentinel限流、熔断、降级
     */
    public static final int SERVICE_UNAVAILABLE  = 503;

    /**
     * 加入会员
     * 状态-会员1否0是
     */
    public static final Integer IS_MEMBERVIP = 0;
    public static final Integer NOT_MEMBERVIP = 1;

    /**
     * 初始化缓存信息
     * 计费规则cache
     */
    public static final class cache {
        public static final String CHARGINGRULE = "ruleKey";        //收费规则key
        public static final String currentAviableStallAmt = "currentAviableStallAmtKey"; //可用券key
        public static final String grouponCodeAmtKey = "grouponCodeAmt";    //兑换码key
        public static final int grouponCodeAmt = 10;
    }

    /**
     * 积分兑换券锁名
     */
    public static final class lock {
        public static final String exchangeCouponLock = "exchangeCouponLock";
    }

    /**
     * 消息类型，pay支付消息，bind绑定消息
     */
    public static final class msgtype {
        public static final String payMsg = "pay";
        public static final String bindMsg = "bind";

    }
}